<%@include file="ValidarSession.jsp"%>
<%@include file="cabecera.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page import="bt.modelo.Pais,java.util.*"%>

<p>
	<strong>Mantenimiento de Empresa &gt; Nuevo</strong>
</p>
<form id="form1" name="form1" method="post"
	action="EmpresaInsertarServlet">
	<table border="1" cellpadding="0" cellspacing="0">
		<tr>
			<td>Razon Social</td>
			<td><label> <input type="text" name="razonSocial"
					id="razonSocial" style="width: 300px;" /> </label></td>
			<td>Direccion</td>
			<td><label> <input type="text" name="direccion"
					id="direccion" style="width: 300px;" /> </label></td>
		</tr>
		<tr>
			<td>Pais</td>
			<td><select name="cmbPais">
					<c:forEach items="${USUARIO_PAISES}" var="p">
						<option value="${p.idPais }">${p.nombre }</option>
					</c:forEach>
			</select></td>
			<td>Departamento</td>
			<td><select name="cmbDepa">
					<c:forEach items="${USUARIO_DEPAS}" var="d">
						<option value="${d.idDepartamento }">${d.nombre }</option>
					</c:forEach>
			</select></td>
		</tr>
		<tr>
			<td>Rubro</td>
			<td><select name="cmbRubro">
					<c:forEach items="${USUARIO_RUBROS}" var="r">
						<option value="${r.idRubro }">${r.descripcion }</option>
					</c:forEach>
			</select></td>
			<td>Contacto</td>
			<td><label> <input type="text" name="contacto"
					id="contacto" style="width: 300px;" /> </label></td>
		</tr>
		<tr>
			<td>Email</td>
				<td><label> <input type="text" name="correo"
					id="correo" style="width: 300px;" /> </label></td>
			<td>Sector</td>
			<td><label> <input type="text" name="sector"
					id="sector" style="width: 300px;" /> </label></td>
		</tr>
		<tr>
			<td>RUC</td>
			<td><label> <input type="text" name="ruc"
					id="ruc" style="width: 300px;" /> </label></td>
			 <td>Password</td>
      <td><label>
        <input type="password" name="clave" id="clave" style="width: 100px; "/>
      </label></td>
		</tr>
		<tr>
			<td colspan="4">
				<input type="submit" value="Guardar" onclick="return isValidEmail();"/> 
				<input	type="button" value="Regresar" onclick="window.location='empBuscar.jsp' " />
			</td>
		</tr>
	</table>
	<p>&nbsp;</p>
</form>
<script type=text/javascript>
function isValidEmail(){
	var email = document.getElementById("correo").value;
	var reEmail = /^(?:\w+\.?)*\w+@(?:\w+\.)+\w+$/;
	if (reEmail.test(email)){
		return true;
	} else {
		alert("Correo electronico invalido.");
		document.getElementById("correo").focus();
		return false;
	}
}
</script>
<%@include file="pie.jsp"%>
